<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>lesson1</title>

    <!-- Bootstrap -->
    <link href="/app/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body ng-app="invoice" ng-strict-di>
    <div class="container">
      <h1>第一课</h1>
      
      <div class="panel panel-default">
        <div class="panel-body">
          <div ng-init="qty=1;cost=2">
            <b>Invoice:</b>
            <div>
              Quantity: <input type="number" min="0" ng-model="qty">
            </div>
            <div>
              Costs: <input type="number" min="0" ng-model="cost">
            </div>
            <div>
              <b>Total:</b> {{qty * cost | currency}}
            </div>
          </div>
        </div>
      </div>
    
      <div class="panel panel-default">
        <div class="panel-body">
          <div  ng-controller="InvoiceController as invoice">
            <b>Invoice:</b>
            <div>
              Quantity: <input type="number" min="0" ng-model="invoice.qty" required >
            </div>
            <div>
              Costs: <input type="number" min="0" ng-model="invoice.cost" required >
              <select ng-model="invoice.inCurr">
                <option ng-repeat="c in invoice.currencies">{{c}}</option>
              </select>
            </div>
            <div>
              <b>Total:</b>
              <span ng-repeat="c in invoice.currencies">
                {{invoice.total(c) | currency:c}}
              </span>
              <button class="btn btn-default" ng-click="invoice.pay()">Pay</button>
            </div>
          </div>
        </div>
      </div> 

      <div class="panel panel-default">
        <div class="panel-body">
          <div ng-controller="InvoiceController2 as invoice">
            <b>Invoice:</b>
            <div>
              Quantity: <input type="number" min="0" ng-model="invoice.qty" required >
            </div>
            <div>
              Costs: <input type="number" min="0" ng-model="invoice.cost" required >
              <select ng-model="invoice.inCurr">
                <option ng-repeat="c in invoice.currencies">{{c}}</option>
              </select>
            </div>
            <div>
              <b>Total:</b>
              <span ng-repeat="c in invoice.currencies">
                {{invoice.total(c) | currency:c}}
              </span>
              <button class="btn btn-default" ng-click="invoice.pay()">Pay</button>
            </div>
          </div>
        </div>
      </div> 
                      
    </div>
    <script src="/app/bower_components/angular/angular.min.js"></script>
    <script src="/lesson1/js/app.js"></script>
    <script src="/lesson1/js/services.js"></script>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="/app/bower_components/jquery/dist/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="/app/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  </body>
</html>